#include"BloomFilter.hpp"

void TestBloomFilter()
{
	BloomFilter<100> bf;//最多存100个值 -》开辟100*4个比特位
	srand(time(0));
	size_t N = 100;
	std::vector<std::string> v2;
	for (size_t i = 0; i < N; ++i)
	{
		std::string url = "https://Mango";
		url += std::to_string(6789 + i);
		v2.push_back(url);
	}

	size_t n2 = 0;
	for (auto& str : v2)
	{
		if (bf.Test(str))
		{
			++n2;
		}
	}
	cout << "相似字符串误判率:" << (double)n2 / (double)N << endl;
}
int main()
{
    TestBloomFilter();
    return 0;
}